package cn.cau.epidemicsurveysystem.bean;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @projectName: gp2023
 * @package: cn.cau.epidemicsurveysystem.bean
 * @className: QuestionAnsBean
 * @author: zy
 * @description: TODO
 * @date: 2022/3/3 15:06
 * @version: 1.0
 */
@Entity
@Table(name = "questionAns", schema = "gp2022", catalog = "")
public class QuestionAnsBean {
    private int ansId;
    private Integer questionId;
    private String ans;
    private Integer patientId;
    private Timestamp date;
    private Integer missionId;

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "ansId")
    public int getAnsId() {
        return ansId;
    }

    public void setAnsId(int ansId) {
        this.ansId = ansId;
    }

    @Basic
    @Column(name = "questionId")
    public Integer getQuestionId() {
        return questionId;
    }

    public void setQuestionId(Integer questionId) {
        this.questionId = questionId;
    }

    @Basic
    @Column(name = "ans")
    public String getAns() {
        return ans;
    }

    public void setAns(String ans) {
        this.ans = ans;
    }

    @Basic
    @Column(name = "patientId")
    public Integer getPatientId() {
        return patientId;
    }

    public void setPatientId(Integer patientId) {
        this.patientId = patientId;
    }

    @Basic
    @Column(name = "date")
    public Timestamp getDate() {
        return date;
    }

    public void setDate(Timestamp date) {
        this.date = date;
    }

    @Basic
    @Column(name = "missionId")
    public Integer getMissionId() {
        return missionId;
    }

    public void setMissionId(Integer missionId) {
        this.missionId = missionId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        QuestionAnsBean that = (QuestionAnsBean) o;
        return ansId == that.ansId && Objects.equals(questionId, that.questionId) && Objects.equals(ans, that.ans) && Objects.equals(patientId, that.patientId) && Objects.equals(date, that.date) && Objects.equals(missionId, that.missionId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ansId, questionId, ans, patientId, date, missionId);
    }
}
